package com.cmyshare.design.facadePattern;

/**
 * @version 1.0
 * @Author cmy
 * @Date 2024/1/31 14:26
 * @desc 外观模式测试类Test
 */
public class Test {
    public static void main(String[] args) {
        //定义Subsystemclasses子系统实现类，向上转型成Subsystemclasses子系统接口
        ServiceA sa = new ServiceAImpl();
        ServiceB sb = new ServiceBImpl();
        //调用接口方法methodA、methodB
        sa.methodA();
        sb.methodB();
        System.out.println("========");
        //实例化外观模式对象
        Facade facade = new Facade();
        //调用外观对象下的任务methodA、methodB
        facade.methodA();
        facade.methodB();
    }
}
